package com.timebank.score.factory;

import com.timebank.common.core.web.pojo.AjaxResult;
import com.timebank.score.pojo.entity.ScoreTask;
import com.timebank.score.service.RemoteScoreTaskService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 积分任务 服务降级处理
 * @author shiliuyinzhen
 */
@Component
public class RemoteScoreTaskFallBackFactory implements FallbackFactory<RemoteScoreTaskService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteScoreTaskFallBackFactory.class);

    @Override
    public RemoteScoreTaskService create(Throwable throwable) {

        log.error("积分任务服务调用失败:{}", throwable.getMessage());

        return new RemoteScoreTaskService(){

        };
    }
}
